function aveCost = objFun(n,m,times,parm,p)
% 目标函数，输入n为检查周期，m为换刀周期
%   times为仿真次数，parm为Weibull分布参数
%   p为几何分布参数
cost = 0;
goodNum = 0;
for i = 1:times
    [temp1,temp2 ] = epoch(n,m,parm,p);
    cost = cost + temp1;
    goodNum = goodNum + temp2;
end
aveCost = cost / goodNum;

end